home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_ambfirstrapids.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  120 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_FirstRapids.cog
  4. #
  5. # Plays random ambient sounds at random positions and drops
  6. # snow at all the positions all the time.
  7. #
  8. # [TRM]
  9. #
  10. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message        entered
  16.     message     pulse
  17.  
  18.     thing        soundPos0        nolink
  19.     thing        soundPos1        nolink
  20.     thing        soundPos2        nolink
  21.     thing       singlePos       nolink
  22.     
  23.     sector      start_Amb1      linkID=1
  24.     sector      start_Amb2      linkID=1
  25.     
  26.     sector      stop_Amb1       linkID=0
  27.     
  28.     sector      start_Single
  29.     sector      sec_Temp
  30.  
  31.     sound        ambient0=shw_amb1.wav   local
  32.     sound        ambient1=shw_amb2.wav   local
  33.     sound        ambient2=shw_amb3.wav   local
  34.     sound        ambient3=shw_amb4.wav   local
  35.     sound        ambient4=shw_amb5.wav   local
  36.     sound        ambient5=shw_amb6.wav   local
  37.     sound        ambient6=shw_amb7.wav   local
  38.     
  39.     template    tpl_Snow=skitosnow      local
  40.     template    tpl_Tim=timsnow         local       # 5m rad snow
  41.     
  42.     int         playing=0               local
  43.     int         single=0                local
  44.     int         randNum                 local
  45.     
  46. end
  47.  
  48. # ========================================================================================
  49.  
  50. code
  51.  
  52. entered:
  53.  
  54.     if((GetSenderID() == 1) && (playing == 0))
  55.     {
  56.         playing = 1;
  57.         single = 0;
  58.         setpulse(2.0);
  59.     }
  60.     
  61.     if(GetSenderID() == 0)
  62.     {
  63.         playing = 0;
  64.         SetPulse(0.0);
  65.     }
  66.     
  67.     if((GetSenderRef() == start_Single) && (playing == 0))
  68.     {
  69.         playing = 1;
  70.         single = 1;
  71.         SetPulse(2.0);
  72.     }
  73.     
  74.     if(GetSenderRef() == sec_Temp)
  75.     {
  76.         playing = 0;
  77.         single = 0;
  78.     }
  79.     
  80.     return;
  81.  
  82. # ========================================================================================
  83.  
  84. pulse:
  85.  
  86.     if(single == 0)
  87.     {
  88.         PlaySoundThing(ambient0[RandBetween(0, 6)], soundPos0[RandBetween(0, 2)], 1.0, 15, 30, 0);
  89.         
  90.         if(GetPerformanceLevel() >= 2)
  91.         {
  92.             CreateThing(tpl_Snow, soundPos0);        
  93.             CreateThing(tpl_Snow, soundPos1);        
  94.             CreateThing(tpl_Snow, soundPos2);
  95.         }
  96.     }
  97.     
  98.     else
  99.     {
  100.         Print("AmbFirstRapids: singlePos");
  101.         
  102.         randNum = RandBetween(1, 3);
  103.         
  104.         if(randNum == 1)
  105.         {
  106.             PlaySoundThing(ambient0[RandBetween(0, 6)], singlePos, 1.0, 5, 20, 0);
  107.         }
  108.         
  109.         if(GetPerformanceLevel() >= 2)
  110.         {
  111.             CreateThing(tpl_Tim, singlePos);
  112.         }
  113.     }        
  114.  
  115.     return;
  116.  
  117. # ========================================================================================
  118.  
  119. end
  120.